-- card: 57358 from stack: in.0
-- bmap block id: 52845
-- flags: 0000
-- background id: 51853
-- name: newInHyperTalk
----- HyperTalk script -----
on closeCard
lock screen
put empty into myLine
put empty into cd fld "Phrase"
put empty into cd fld "WhatItIs"
put empty into cd fld "Definition"
hide cd fld "Examples"
set scroll of cd fld "Examples" to 0
set scroll of cd fld "List" to 0
unlock screen with visual wipe left
end closeCard
function getchunk inWord,myDict
put return & inWord & return into inWord
put (number of lines in char 1 to (offset(inWord,myDict)) of myDict)+1 into myLines
if myLines is 1 then
return empty
exit getChunk
end if
put line myLines to (number of lines in myDict) of myDict into myStuff
delete char (offset("[",myStuff)) to length(myStuff) of myStuff
return myStuff
end getChunk
on v
set visible of cd fld "ExampleList" to not visible of cd fld "ExampleList"
end v
on k
if not the visible of cd fld "Defs" then
show cd fld "WhatList"
show cd fld "Defs"
show cd fld "ExampleList"
else
hide cd fld "WhatList"
hide cd fld "Defs"
hide cd fld "ExampleList"
end if
end k
-- part 1 (field)
-- low flags: 01
-- high flags: 2000
-- rect: left=274 top=58 right=109 bottom=463
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 1
-- font id: 174
-- text size: 18
-- style flags: 0
-- line height: 20
-- part name: Phrase
-- part 2 (field)
-- low flags: 01
-- high flags: 2007
-- rect: left=44 top=58 right=266 bottom=265
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 0
-- font id: 174
-- text size: 12
-- style flags: 0
-- line height: 15
-- part name: List
----- HyperTalk script -----
on mouseUp
lock screen
set cursor to watch
put empty into myLine
put empty into cd fld "Phrase"
put empty into cd fld "WhatItIs"
put empty into cd fld "Definition"
set scroll of cd fld "Definition" to 0
hide cd fld "Examples"
unlock screen with visual wipe left
lock screen
put lineNo() into myLine
put line myLine of me into cd fld "Phrase"
put line myLine of cd fld "WhatList" into cd fld "WhatItIs"
-- put line 2 to 40 of getChunk(myLine,cd fld "Defs") into cd fld "Definition"
put line myLine of cd fld "Defs" into cd fld "Definition"
put line 2 to 40 of getChunk(myLine,cd fld "ExampleList") into cd fld "Examples"
set scroll of cd fld "Examples" to 0
unlock screen with visual wipe right
end mouseUp
function lineNo
if the style of the target is "scrolling" then
return ((item 2 of the clickloc - item 2 of the rect of the target + the scroll of the target-2) DIV textheight of the target) +1
else
return ((item 2 of the clickloc - item 2 of the rect of the target) DIV textheight of the target) +1
end if
end lineNo
-- part 3 (field)
-- low flags: 01
-- high flags: 2007
-- rect: left=274 top=130 right=240 bottom=463
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 0
-- font id: 174
-- text size: 14
-- style flags: 0
-- line height: 18
-- part name: Definition
-- part 4 (field)
-- low flags: 01
-- high flags: 0000
-- rect: left=274 top=110 right=129 bottom=463
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 1
-- font id: 174
-- text size: 12
-- style flags: 0
-- line height: 16
-- part name: WhatItIs
-- part 5 (button)
-- low flags: 00
-- high flags: A004
-- rect: left=275 top=243 right=265 bottom=464
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 1
-- font id: 174
-- text size: 12
-- style flags: 16384
-- line height: 16
-- part name: EXAMPLES
----- HyperTalk script -----
on mouseUp
if cd fld "Phrase" is empty then
answer "Please select a topic first."
else
set the visible of cd fld "Examples" to not the visible of cd fld "Examples"
end if
end mouseUp
-- part 6 (field)
-- low flags: 81
-- high flags: 2007
-- rect: left=274 top=130 right=240 bottom=463
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 0
-- font id: 174
-- text size: 12
-- style flags: 0
-- line height: 16
-- part name: Examples
----- HyperTalk script -----
on mouseUp
hide me
end mouseUp
-- part 7 (field)
-- low flags: 81
-- high flags: 2007
-- rect: left=265 top=58 right=266 bottom=448
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 0
-- font id: 174
-- text size: 12
-- style flags: 0
-- line height: 15
-- part name: WhatList
----- HyperTalk script -----
on mouseUp
put lineNo() into myLine
put line myLine of me into cd fld "Phrase"
end mouseUp
function lineNo
if the style of the target is "scrolling" then
return ((item 2 of the clickloc - item 2 of the rect of the target + the scroll of the target) DIV textheight of the target) +1
else
return ((item 2 of the clickloc - item 2 of the rect of the target) DIV textheight of the target) +1
end if
end lineNo
-- part 11 (field)
-- low flags: 01
-- high flags: 0000
-- rect: left=0 top=4 right=25 bottom=512
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 1
-- font id: 174
-- text size: 14
-- style flags: 2304
-- line height: 18
-- part name:
-- part 12 (button)
-- low flags: 00
-- high flags: 2000
-- rect: left=448 top=311 right=342 bottom=498
-- title width / last selected line: 0
-- icon id / first selected line: 5233 / 5233
-- text alignment: 1
-- font id: 0
-- text size: 12
-- style flags: 0
-- line height: 16
-- part name:
----- HyperTalk script -----
on mouseUp
lock screen
go to card "HyperTalk & XCM"
unlock screen with iris close
end mouseUp
-- part 14 (field)
-- low flags: 81
-- high flags: 2004
-- rect: left=141 top=77 right=248 bottom=388
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 0
-- font id: 174
-- text size: 14
-- style flags: 0
-- line height: 15
-- part name: INSTRUCTIONS
----- HyperTalk script -----
on mouseUp
set the hilite of btn "instructions" to false
hide me
end mouseUp
-- part 15 (button)
-- low flags: 00
-- high flags: 0000
-- rect: left=374 top=315 right=337 bottom=446
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 1
-- font id: 0
-- text size: 12
-- style flags: 0
-- line height: 16
-- part name: Instructions
----- HyperTalk script -----
on mouseUp
set the hilite of me to not the hilite of me
set the visible of cd fld "instructions" to not the visible of cd fld "instructions"
end mouseUp
-- part 10 (field)
-- low flags: 81
-- high flags: 0007
-- rect: left=0 top=266 right=342 bottom=246
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 0
-- font id: 3
-- text size: 9
-- style flags: 0
-- line height: 12
-- part name: ExampleList
----- HyperTalk script -----
on closeField
put the length of me
end closeField
-- part 9 (field)
-- low flags: 81
-- high flags: 0007
-- rect: left=0 top=266 right=342 bottom=226
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 0
-- font id: 3
-- text size: 9
-- style flags: 0
-- line height: 12
-- part name: Defs
----- HyperTalk script -----
on mouseUp
put lineNo() into myLine
put line myLine of me into cd fld "Phrase"
put line myLine of cd fld "WhatList" into cd fld "WhatItIs"
end mouseUp
function lineNo
if the style of the target is "scrolling" then
return ((item 2 of the clickloc - item 2 of the rect of the target + the scroll of the target) DIV textheight of the target) +1
else
return ((item 2 of the clickloc - item 2 of the rect of the target) DIV textheight of the target) +1
end if
end lineNo
-- part contents for card part 2
----- text -----
scriptTextStyle
scriptTextFont
scriptTextSize
scriptEditor
debugger
messageWatcher
messageWatching
variableWatcher
variableWatching
stacksInUse
enabled (menu)
name (menu)
enabled (menuItem)
name (menuItem)
checkMark
markChar
textStyle (menuItem)
commandChar
menuMessage
scroll
rectangle
cantPeek
cantAbort
dontSearch (bkgnd)
marked
dontSearch (card)
rectangle
sharedHilite
fixedLineHeight
dontSearch (field)
dontWrap
sharedText
clickChunk
clickLine
clickText
the number of marked cards
the number of menus
the menus
the number of menuItems of